package com.example.heathy_me.medicineDetail;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.example.heathy_me.R;

public class MedicineContentActivity extends AppCompatActivity {

    public static void actionStart(Context context, String medicineTitle, String medicineContent) {
        Intent intent = new Intent(context, MedicineContentActivity.class);
        intent.putExtra("medicine_title", medicineTitle);
        intent.putExtra("medicine_content", medicineContent);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.medicine_content);
        String medicineTitle = getIntent().getStringExtra("medicine_title"); // 获取传入的标题
        String medicineContent = getIntent().getStringExtra("medicine_content"); // 获取传入的内容
        MedicineContentFragment medicineContentFragment = (MedicineContentFragment) getSupportFragmentManager().findFragmentById(R.id.medicine_content_fragment);
        medicineContentFragment.refresh(medicineTitle, medicineContent); // 刷新medicineContentFragment界面
    }

}
